<script type="text/javascript" language="javascript" charset="utf-8">
$(".header-con li a").removeClass("open-menu");
$(".header-con li #target").addClass("open-menu");
</script>
<div class="boxed clearfix">
  <div class="mask">
  </div>
  <div class="common-tit">
    <h2>未分配学员</h2>
    <span>团队管理 > 未分配学员</span>
    <!-- <a class="add-staff" href="javascript:;">添加员工</a> -->
  </div>
  <div class="n-assig">
    <div class="scrollbox">
      <table>
        <thead>
          <tr>
            <th class="nas-img">头像</th>	
            <th class="nas-name">姓名</th>
            <th class="nas-age">年龄阶段</th>
            <th class="nas-gro">学员分组</th>
            <th class="nas-fd">意向分店</th>
            <th class="nas-consu">消费能力</th>
            <th class="nas-operation">
              <div>
                <em>操作</em>
              </div>
            </th>
          </tr>
        </thead>
        <tbody>
          <% @students.each do |stu| %>
          <tr>
            <td>
              <div class="as-imgbox">
                <img src="" alt="">
              </div>
            </td>	
            <td><%= stu.name %></td>
            <td><%= stu.student_age_group %></td>
            <td><%= stu.student_group_configuration.group_name %></td>
            <td><%= stu.studio.name %></td>
            <td>10K - 20K</td>
            <td class="as-operation">
              <div>
                <em>[</em>
                <%= link_to "查看详情", admin_targets_student_path(stu) %>
                <em>]</em>
                <em>[</em>
                <span><%= link_to "指派顾问", assign_admin_targets_student_path(stu), remote: true %></span>
                <em>]</em>
              </div>
            </td>
          </tr>
          <% end %>
        </tbody>
      </table>
    </div>
  </div>
</div>
<script src="/assets/js/jquery-1.12.3.js"></script>
<script src="/assets/js/common-list.js"></script>
<script>
/* 单选下拉列表 */
$(".single-downbtn").on("click", function() {
  if ($(this).next(".single-dropdown").hasClass("menuopen")) {
    $(this).next(".single-dropdown").removeClass("menuopen");
  } else {
    $(this).next(".single-dropdown").addClass("menuopen");
    $(this).parent().hover(function() {

    }, function() {
      $(this).children(".single-dropdown").removeClass("menuopen");
    });
    $(".single-box .menuopen li").on("click", function() {
      $(this).parent().parent().removeClass("menuopen");
      $(this).parent().parent().parent().find("span").text($(this).text());
      $(this).parent().parent().find("input").val("");
      $(".single-dropdown li").removeClass("mul-hide");
    });
    $(this).next("div").find("input").on('input',function(){ 
      console.log($(this));
      if ($(this).val() != "") {
        console.log($(this).val());
        $(".single-dropdown li").addClass("mul-hide");
        console.log($($(".single-dropdown li:contains(" + $(this).val() + ")")).removeClass("mul-hide"));
      } else {
        $(".single-dropdown li").removeClass("mul-hide");
      }
    })
  }
}); 
</script>
